home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 February: Tool Chest / Apple Developer CD Series Tool Chest February 1996 (Apple Computer)(1996).iso / Sample Code / AOCE Sample Code / PowerTalk Access Modules / Sample PMSAM / PMSAM Framework / RoboSamSlot / MSAMSlot.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-07-28  |  3.6 KB  |  151 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        MSAMSlot.h
  3.  
  4.     Contains:    xxx put contents here xxx
  5.  
  6.     Written by:    Tim Harnett
  7.  
  8.     Copyright:    © 1994 by Apple Computer, Inc., all rights reserved.
  9.  
  10.     Change History (most recent first):
  11.  
  12.         <16>     2/16/95    TMH        got rid of ProcessIncomingMail
  13.         <15>     2/15/95    TMH        added SetSlotID()
  14.         <14>     2/14/95    TMH        replace GetEWorldSlot and GetHFSSlot with GetExternalSlot
  15.         <13>     2/10/95    TMH        change wireless to HFS
  16.         <12>    12/20/94    TMH        added IsLocationActive(), Busy()
  17.         <11>    12/16/94    TMH        added GetOutTrayLetterInfo(), IsLetterDone·
  18.         <10>    12/12/94    TMH        modified so slot Id is written only once
  19.          <9>    10/28/94    TMH         fixed null terminator bug in GetUserPassword
  20.          <8>    10/18/94    TMH        read the users name and password
  21.          <7>    10/14/94    TMH        added GetDirExtType()
  22.          <6>    10/13/94    TMH        added IsOurRecipient
  23.          <5>    10/11/94    TMH        CommThread integration
  24.          <4>     10/6/94    TMH        move LogError and GetLogEntry to LogErrors.cp
  25.          <3>     10/3/94    TMH        break of THFS&TEWorld from TExternalSlot
  26.          <2>     9/22/94    TMH        added use of CQueueEnumerator.cp,.h
  27.          <1>     9/20/94    TMH        Abandon RoadsideRest embrace Mercury
  28.          <2>      9/9/94    TMH        TIncoming/TOutgoing adaptations
  29.                  4/12/94    TMH        xxx put comment here xxx
  30.  
  31.     To Do:
  32. */
  33.  
  34. #ifndef __MSAMSlot__
  35. #define __MSAMSlot__
  36.  
  37. class TSlotThread;
  38. class TExternalSlot;
  39. class TEWorldSlot;
  40. class TIncomingXLetter;
  41. class TOutgoingALetter;
  42. class CUnpackedDSSpec;
  43.  
  44. #ifndef __OCE__
  45. #include <OCE.h>
  46. #endif
  47.  
  48. #ifndef __OCEMAIL__
  49. #include <OCEMail.h>
  50. #endif
  51.  
  52. #ifndef __CRecordID__
  53. #include "CRecordID.h"
  54. #endif
  55.  
  56. #ifndef __Debug__
  57. #include "Debug.h"
  58. #endif
  59.  
  60.  
  61. //--------------------------------------
  62. //        T M S A M S l o t 
  63. //--------------------------------------
  64.  
  65.     
  66.  
  67. class TMSAMSlot {
  68. public:    
  69.  
  70.         //    Construction, Initialization, Destruction
  71.  
  72.                     TMSAMSlot();
  73.                     ~TMSAMSlot();
  74.         void        IMSAMSlot(CreationID* slotCID);
  75.             
  76.         OSErr            SetSlotInfo();
  77.         void             SetLocationFlags(MailLocationFlags locationFlags) { fStdSlotInfo.active = locationFlags; };
  78.  
  79.         OSErr             OpenQueues();
  80.         OSErr             Activate();
  81.         
  82.             //----------------
  83.             //    Accessors
  84.             //----------------
  85.             
  86.         MSAMQueueRef     GetInQueueRef();
  87.         MSAMQueueRef    GetOutQueueRef();
  88.         short             GetSlotID();
  89.         void             SetSlotID(short slotID) { fSlotID = slotID; };
  90.         CreationID        GetSlotCID() { return fSlotRecord->fCID; };
  91.         CRecordID*        GetSlotRecord() { return fSlotRecord; };
  92.         CRecordID*        GetDirectoryRecord() { return fDirectoryRecord; };
  93.  
  94.  
  95.         char*            GetExSysUserName(char* userName);
  96.         char*            GetExSysPassword(char* password);
  97.  
  98.  
  99.         TSlotThread*    GetSlotThread() { return fSlotThread; };
  100.         
  101.         TExternalSlot*    GetExternalSlot();
  102.         
  103.         CDirectoryName&    GetDirectoryName() { ASSERT(fDirectoryRecord); return (CDirectoryName&) fDirectoryRecord->Name(); }
  104.         OSType            GetDirExtType() { return fDirDiscriminator.signature; }
  105.  
  106.  
  107.  
  108.         Boolean            IsOurRecipient(CUnpackedDSSpec& recipient);
  109.  
  110.  
  111.         Boolean         IsLocationEnabled();
  112.         Boolean            IsEnabled() { return this->IsLocationEnabled() && (this->GetOutQueueRef() != 0) ; }
  113.         
  114.         Boolean            Busy();
  115.         
  116.             //    Letter Processing
  117.             
  118.         long                CountOutgoingLetters();
  119.         TOutgoingALetter*    GetOutgoingLetter();    
  120.  
  121.         OSErr                 GetOutTrayLetterInfo(long letterSeqNo,MSAMEnumerateOutQReply& outQReply);
  122.         Boolean             IsLetterDone(long letterSeqNo);
  123.  
  124.  
  125. private:
  126.         OSErr            ReadDirectoryInfo();
  127.         OSErr            ReadExSysUserNameAndPassword();
  128.  
  129. private:
  130.     
  131.     short                            fSlotID;
  132.     CRecordID*                        fSlotRecord;
  133.     CRecordID*                        fDirectoryRecord;
  134.     DirDiscriminator                fDirDiscriminator;
  135.     
  136.     CRecordName                        fUserName;
  137.     CRString32                        fPassword;
  138.     
  139.     MailStandardSlotInfoAttribute    fStdSlotInfo;
  140.     MSAMQueueRef                    fInQueueRef;
  141.     MSAMQueueRef                    fOutQueueRef;
  142.     
  143.     TSlotThread*                    fSlotThread;
  144.     
  145.     TExternalSlot*                    fExternalSlot;
  146. };
  147.  
  148.  
  149.  
  150.  
  151. #endif __MSAMSlot__